using Godot;
using System;

public partial class Ui : Control,IComponent
{
	public GuiViewConfig config;
	public string viewInstanceID;//实例ID
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public virtual void enter()
	{
		GetTree().Paused = true;
		var Game = GetNode<Game>("/root/Game");
		var UIControl = GetNode<UIControl>("/root/UIControl");
		UIControl.GetGuiViewManager().InstanceUIsList.Add(this);
		Game._timer.Start(0.1);
	}

	public virtual void exit()
	{
		GetTree().Paused = false;
		var Game = GetNode<Game>("/root/Game");
		var UIControl = GetNode<UIControl>("/root/UIControl");
		UIControl.GetGuiViewManager().InstanceUIsList.Remove(this);
		Game._timer.Start(0.1);
	}
	public virtual void close_self()
	{
		var UIControl = GetNode<UIControl>("/root/UIControl");
		UIControl.GetGuiViewManager().close_view(viewInstanceID);
	}

    public virtual void Initialize()
    {
       
    }

    public void Update(double delta)
    {
    }

}
